home *** CD-ROM | disk | FTP | other *** search
INI File | 1996-03-15 | 9.4 KB | 599 lines |
- [MainInfo$]
- CCVer=2.1
- Compatible20=0
- Compatible21=1
- UnitName=Clocklbl
- NewClassName=TClockLabel
- ParentClassName=TCustomLabel
- DefaultPalette=Samples
- CopyrightLine=A public domain component
- FormMode=0
- FormFile=
-
- [Units$]
- Lines=10
- L1=Classes
- L2=Controls
- L3=ExtCtrls
- L4=Forms
- L5=Graphics
- L6=Messages
- L7=Stdctrls
- L8=SysUtils
- L9=WinProcs
- L10=WinTypes
-
- [ItemList$]
- Create=Method
- Destroy=Method
- Paint=Method
- OnClick=ExistingEvent
- OnDblClick=ExistingEvent
- OnDragDrop=ExistingEvent
- OnDragOver=ExistingEvent
- OnEndDrag=ExistingEvent
- OnMouseDown=ExistingEvent
- OnMouseMove=ExistingEvent
- OnMouseUp=ExistingEvent
- ShowDate=Property
- ShowTime=Property
- DateStr=Property
- TimeStr=Property
- TimeSep=Property
- DateFmtUSA=Property
- TimeFmt24hr=Property
- Font=Property
- Visible=Property
- NewCaption=Method
- Update=Method
- Timer=Variable
-
- [Global$]
- Descr=Label to display date and current time of day
- DefaultCode=1
-
- [Code$]
- Lines=0
-
- [Help$]
- Lines=0
-
- [Create]
- Descr=
- DefaultCode=2
- Kind=2
- Header=Create(AOwner: TComponent)
- S=0
- Ov=1
- Mode=2
- WinMessage=
-
- [CreateCode$]
- Lines=12
- L1=begin
- L2=~~~~~{ Call the Create method of the parent class }
- L3=~~~~~inherited Create(AOwner);
- L4=
- L5=~~~~~{ Set the initial values of variables and properties and }
- L6=~~~~~{ create object for Timer variable. }
- L7=~~~~~{ AutoInitialize procedure is generated by Component Create. }
- L8=~~~~~AutoInitialize;
- L9=
- L10=~~~~~{ Start timer }
- L11=~~~~~Timer.Enabled := True
- L12=end;
-
- [CreateHelp$]
- Lines=0
-
- [Destroy]
- Descr=
- DefaultCode=4
- Kind=3
- Header=Destroy
- S=0
- Ov=1
- Mode=2
- WinMessage=
-
- [DestroyCode$]
- Lines=9
- L1=begin
- L2=~~~~~{ AutoDestroy, which is generated by Component Create, frees any }
- L3=~~~~~{ objects created by AutoInitialize. }
- L4=~~~~~AutoDestroy;
- L5=
- L6=~~~~~{ Free the component by calling the Destroy method of the }
- L7=~~~~~{ parent class. }
- L8=~~~~~inherited Destroy;
- L9=end;
-
- [DestroyHelp$]
- Lines=0
-
- [Paint]
- Descr=
- DefaultCode=5
- Kind=0
- Header=Paint
- S=1
- Ov=1
- Mode=2
- WinMessage=
-
- [PaintCode$]
- Lines=7
- L1=begin
- L2=~~~~~{ Update the caption of the label with the current date
- L3=~~~~~~~and time string, then call the Paint method of the
- L4=~~~~~~~parent class to re-draw }
- L5=~~~~~Caption := NewCaption;
- L6=~~~~~inherited Paint;
- L7=end;
-
- [PaintHelp$]
- Lines=0
-
- [OnClick]
- Descr=
- DefaultCode=7
- Ov=0
- P=0
- HandlerDecl=Click
-
- [OnClickCode$]
- Lines=0
-
- [OnClickHelp$]
- Lines=0
-
- [OnDblClick]
- Descr=
- DefaultCode=8
- Ov=0
- P=0
- HandlerDecl=DblClick
-
- [OnDblClickCode$]
- Lines=0
-
- [OnDblClickHelp$]
- Lines=0
-
- [OnDragDrop]
- Descr=
- DefaultCode=13
- Ov=0
- P=0
- HandlerDecl=DragDrop(DragObject: TObject; X, Y: Integer)
-
- [OnDragDropCode$]
- Lines=0
-
- [OnDragDropHelp$]
- Lines=0
-
- [OnDragOver]
- Descr=
- DefaultCode=0
- Ov=0
- P=0
- HandlerDecl=
-
- [OnDragOverCode$]
- Lines=0
-
- [OnDragOverHelp$]
- Lines=0
-
- [OnEndDrag]
- Descr=
- DefaultCode=13
- Ov=0
- P=0
- HandlerDecl=
-
- [OnEndDragCode$]
- Lines=0
-
- [OnEndDragHelp$]
- Lines=0
-
- [OnMouseDown]
- Descr=
- DefaultCode=13
- Ov=0
- P=0
- HandlerDecl=MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer)
-
- [OnMouseDownCode$]
- Lines=0
-
- [OnMouseDownHelp$]
- Lines=0
-
- [OnMouseMove]
- Descr=
- DefaultCode=13
- Ov=0
- P=0
- HandlerDecl=MouseMove(Shift: TShiftState; X, Y: Integer)
-
- [OnMouseMoveCode$]
- Lines=0
-
- [OnMouseMoveHelp$]
- Lines=0
-
- [OnMouseUp]
- Descr=
- DefaultCode=13
- Ov=0
- P=0
- HandlerDecl=MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer)
-
- [OnMouseUpCode$]
- Lines=0
-
- [OnMouseUpHelp$]
- Lines=0
-
- [ShowDate]
- Descr=Include date in display?
- DefaultCode=6
- IN=0
- RO=0
- PropType=Boolean
- PropDefault=True
- Quote=0
- RM=0
- WM=1
- Hide=0
- DefEdit=1
- All=0
- EC=
- EU=
- Link=
-
- [ShowDateCode$]
- Lines=5
- L1=begin
- L2=~~~~~FShowDate := Value;
- L3=~~~~~{ Changing this value changes the display, so ... }
- L4=~~~~~Invalidate;
- L5=end;
-
- [ShowDateHelp$]
- Lines=0
-
- [ShowTime]
- Descr=Include time in display?
- DefaultCode=6
- IN=0
- RO=0
- PropType=Boolean
- PropDefault=True
- Quote=0
- RM=0
- WM=1
- Hide=0
- DefEdit=1
- All=0
- EC=
- EU=
- Link=
-
- [ShowTimeCode$]
- Lines=5
- L1=begin
- L2=~~~~~FShowTime := Value;
- L3=~~~~~{ Changing this value changes the display, so ... }
- L4=~~~~~Invalidate;
- L5=end;
-
- [ShowTimeHelp$]
- Lines=0
-
- [DateStr]
- Descr=Current date
- DefaultCode=6
- IN=0
- RO=1
- PropType=String
- PropDefault=
- Quote=0
- RM=1
- WM=0
- Hide=0
- DefEdit=1
- All=0
- EC=
- EU=
- Link=
-
- [DateStrCode$]
- Lines=0
-
- [DateStrReadCode$]
- Lines=18
- L1=const
- L2=~~~~~Months : array[1..12] of String[10] =
- L3=~~~~~~~~~~~~~~('January','February','March','April','May','June',
- L4=~~~~~~~~~~~~~~'July','August','September','October','November','December');
- L5=~var
- L6=~~~~~Year, Month, Day, Weekday : Word;
- L7=~~~~~DayStr, YearStr : String[10];
- L8=begin
- L9=~~~~~(* Obtain the date information *)
- L10=~~~~~DecodeDate(Now, Year, Month, Day);
- L11=~~~~~Str(Day, DayStr);
- L12=~~~~~Str(Year, YearStr);
- L13=~~~~~if FDateFmtUSA then
- L14=~~~~~~~~~~FDateStr := Months[Month] + ' ' + DayStr + ', ' + YearStr
- L15=~~~~~else
- L16=~~~~~~~~~~FDateStr := DayStr + ' ' + Months[Month] + ' ' + YearStr;
- L17=~~~~~GetDateStr := FDateStr
- L18=end;
-
- [DateStrHelp$]
- Lines=0
-
- [TimeStr]
- Descr=Current time
- DefaultCode=6
- IN=0
- RO=1
- PropType=String
- PropDefault=
- Quote=0
- RM=1
- WM=0
- Hide=0
- DefEdit=1
- All=0
- EC=
- EU=
- Link=
-
- [TimeStrCode$]
- Lines=0
-
- [TimeStrReadCode$]
- Lines=26
- L1=~var
- L2=~~~~~Hour, Minute, Seconds, Hundreds : Word;
- L3=~~~~~HourStr, MinuteStr, AmPm : String[10];
- L4=begin
- L5=~~~~~(* Obtain the time information *)
- L6=~~~~~DecodeTime(Now, Hour, Minute, Seconds, Hundreds);
- L7=~~~~~(* Take account of 12-hour time, if necessary *)
- L8=~~~~~if FTimeFmt24hr then
- L9=~~~~~~~~~~AmPm := ''
- L10=~~~~~else
- L11=~~~~~~~~~~if Hour > 12 then
- L12=~~~~~~~~~~~~~~~begin
- L13=~~~~~~~~~~~~~~~Hour := Hour - 12;
- L14=~~~~~~~~~~~~~~~AmPm := ' pm'
- L15=~~~~~~~~~~~~~~~end
- L16=~~~~~~~~~~else
- L17=~~~~~~~~~~~~~~~AmPm := ' am';
- L18=~~~~~(* Convert the time values to strings *)
- L19=~~~~~Str(Hour, HourStr);
- L20=~~~~~Str(Minute, MinuteStr);
- L21=~~~~~(* Add leading zero if Minute is one digit *)
- L22=~~~~~if Minute < 10 then
- L23=~~~~~~~~~~MinuteStr := '0' + MinuteStr;
- L24=~~~~~FTimeStr := HourStr + FTimeSep + MinuteStr + AmPm;
- L25=~~~~~GetTimeStr := FTimeStr
- L26=end;
-
- [TimeStrHelp$]
- Lines=0
-
- [TimeSep]
- Descr=Field separator for time string
- DefaultCode=6
- IN=0
- RO=0
- PropType=String
- PropDefault=':'
- Quote=1
- RM=0
- WM=1
- Hide=0
- DefEdit=1
- All=0
- EC=
- EU=
- Link=
-
- [TimeSepCode$]
- Lines=5
- L1=begin
- L2=~~~~~FTimeSep := Value;
- L3=~~~~~{ Changing this value changes the display, so ... }
- L4=~~~~~Invalidate;
- L5=end;
-
- [TimeSepHelp$]
- Lines=0
-
- [DateFmtUSA]
- Descr=Use U.S. format for date (mm dd, yy)?
- DefaultCode=6
- IN=0
- RO=0
- PropType=Boolean
- PropDefault=True
- Quote=0
- RM=0
- WM=1
- Hide=0
- DefEdit=1
- All=0
- EC=
- EU=
- Link=
-
- [DateFmtUSACode$]
- Lines=6
- L1=begin
- L2=~~~~~FDateFmtUSA := Value;
- L3=~~~~~{ Changing this property affects the appearance of
- L4=~~~~~~~the component, so ... }
- L5=~~~~~Invalidate;
- L6=end;
-
- [DateFmtUSAHelp$]
- Lines=0
-
- [TimeFmt24hr]
- Descr=Display 24-hour time or 12-hour?
- DefaultCode=6
- IN=0
- RO=0
- PropType=Boolean
- PropDefault=False
- Quote=0
- RM=0
- WM=1
- Hide=0
- DefEdit=1
- All=0
- EC=
- EU=
- Link=
-
- [TimeFmt24hrCode$]
- Lines=4
- L1=begin
- L2=~~~~~FTimeFmt24hr := Value;
- L3=~~~~~Invalidate
- L4=end;
-
- [TimeFmt24hrHelp$]
- Lines=0
-
- [Font]
- Descr=Publish Font property of parent class
- DefaultCode=6
- IN=1
- RO=0
- PropType=TFont
- PropDefault=
- Quote=0
- RM=0
- WM=0
- Hide=0
- DefEdit=1
- All=0
- EC=
- EU=
- Link=
-
- [FontCode$]
- Lines=0
-
- [FontHelp$]
- Lines=0
-
- [Visible]
- Descr=Publish Visible property of parent class
- DefaultCode=6
- IN=1
- RO=0
- PropType=Boolean
- PropDefault=True
- Quote=0
- RM=0
- WM=0
- Hide=0
- DefEdit=1
- All=0
- EC=
- EU=
- Link=
-
- [VisibleCode$]
- Lines=0
-
- [VisibleHelp$]
- Lines=0
-
- [NewCaption]
- Descr=Returns updated time and date string
- DefaultCode=0
- Kind=1
- Header=NewCaption : String
- S=2
- Ov=0
- Mode=2
- WinMessage=
-
- [NewCaptionCode$]
- Lines=13
- L1=var
- L2=~~~~~DisplayLine : String;
- L3=begin
- L4=~~~~~if FShowDate then
- L5=~~~~~~~~~~DisplayLine := GetDateStr
- L6=~~~~~else
- L7=~~~~~~~~~~DisplayLine := '';
- L8=~~~~~if FShowDate and FShowTime then
- L9=~~~~~~~~~~DisplayLine := DisplayLine + ' ';
- L10=~~~~~if FShowTime then
- L11=~~~~~~~~~~DisplayLine := DisplayLine + GetTimeStr;
- L12=~~~~~NewCaption := DisplayLine
- L13=end;
-
- [NewCaptionHelp$]
- Lines=0
-
- [Update]
- Descr=Forces update to label; triggered by Timer's OnTimer events
- DefaultCode=0
- Kind=0
- Header=Update(Sender : TObject)
- S=2
- Ov=0
- Mode=2
- WinMessage=
-
- [UpdateCode$]
- Lines=10
- L1={ The component calls Update method periodically to keep
- L2=~~the time display current. Update has been declared with
- L3=~~one argument of type TObject so it can be assigned as the
- L4=~~OnTimer event handler for variable Timer. }
- L5=
- L6=begin
- L7=~~~~~{ Has the time and date display changed? If so, re-draw }
- L8=~~~~~if NewCaption <> Caption then
- L9=~~~~~~~~Invalidate
- L10=end;
-
- [UpdateHelp$]
- Lines=0
-
- [Timer]
- Descr=Internal timer for updating time display
- DefaultCode=17
- DataType=TTimer
- Default=
- Quote=0
- Sc=10
- IsObject=1
- IsSubComponent=1
-
- [TimerCode$]
- Lines=6
- L1=begin
- L2={ Trigger OnTimer events every 30 seconds }
- L3=Interval := 30000;
- L4={ OnTimer events will generate call to Update procedure }
- L5=OnTimer := Update;
- L6=end;
-
- [TimerHelp$]
- Lines=0
-